import axios from '../../axios/index'

export interface invoiceParams {
    current: number
    size: number
    invoiceCompany?: string //发票抬头
    invoiceStatus?: number //发票状态 1.开票中；2.开票成功
}
/**
 * 开票分页
 * @param params
 * @param current: number
 * @param size: number
 * @param invoiceCompany?: string //发票抬头
 * @param invoiceStatus?: number //发票状态 1.开票中；2.开票成功
 * @returns
 */
export const invoiceList = (params: invoiceParams) => {
    return axios({
        method: 'get',
        url: '/api/mall/invoice/queryInvoicePageList',
        params
    })
}

/**
 * 通过id 开票
 * @param id
 * @returns
 */
export const invoiceDo = (id: string) => {
    return axios({
        method: 'post',
        url: '/api/mall/invoice/doInvoice',
        data: { id }
    })
}

/**
 * 获取开票订单详情
 * @param id
 * @returns
 */
export const invoiceDetailed = (id: string) => {
    return axios({
        method: 'get',
        url: '/api/mall/invoice/findById',
        params: { id }
    })
}
